/**
 * 
 */
package com.zte.claa.inficombo.csa.app.service.rptparse;

import com.zte.claa.inficombo.csa.app.model.redis.ProjectDev;

/**
 * @author 0283000115
 *
 * 经过一次解析后的GSP/SSP所带传感终端的原始数据.
 */
public class SensorOrgData {
	private String dtueui;
	private String sensorid;
	private byte[] payload;
	
	public SensorOrgData(){
		
	}

	public String getDtueui() {
		return dtueui;
	}

	public void setDtueui(String dtueui) {
		this.dtueui = dtueui;
	}

	public String getSensorid() {
		return sensorid;
	}

	public void setSensorid(String sensorid) {
		this.sensorid = sensorid;
	}

	public byte[] getPayload() {
		return payload;
	}

	public void setPayload(byte[] payload) {
		this.payload = payload;
	}
	
	// 注意，调用之前需要首先设置dtuEUI和sensorId.
	public String getSensorEui(){
		return ProjectDev.formatSensorEui(this.sensorid, this.dtueui);
	}

	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append("dtueui=").append(dtueui).append(",");
		sb.append("sensorid=").append(sensorid);
		if(this.payload != null){
			sb.append(", payloadsize=").append(this.payload.length);
		}	
		return sb.toString();		
	}

}
